# -*- coding: utf-8 -*-
import time
from selenium import webdriver
import unittest
from Page.financingplatformloginPage import financingplatformloginPage
from publicModule.financingplatformlogin import financingplatformlogin
from publicModule.bank import bank
from Page.bankPage import bankPage
import xlrd
class Test_Bank(unittest.TestCase):

    @classmethod
    def setUpClass(self):
        print('资金平台')
        self.driver = webdriver.Ie()
        self.driver.implicitly_wait(10)
        self.driver.maximize_window()
        self.driver.get("http://10.22.26.45:7002/fwd-front/bizframe/jsp/login.jsp")

        time.sleep(1)
        self.financingplatformloginPage=financingplatformloginPage(self.driver)
        self.bank=bank(self.driver)
        self.bankPage=bankPage(self.driver)

    # @classmethod
    # def tearDownClass(self):
    #     print('结束测试')
    #     self.driver.quit()
    #登录
    def test01(self):
        print('资金平台')
        filename = '..//TestData//loginData.xlsx'
        excel_open = xlrd.open_workbook(filename)
        table = excel_open.sheet_by_name('Sheet1')
        rows = table.nrows
        for i in range(2, rows):
            row_content = table.row_values(i)
            LoginName = row_content[6]
            Password = row_content[7]
        financingplatformlogin.financingplatformlogin(self, LoginName, Password)
        time.sleep(2)

    def test02(self):
        print('即将进入历史明细')
        bank.History_Subsidiary(self)







if __name__ =='__main__':
    suite = unittest.TestLoader.loadTestsFromTestCase(Test_Bank)
    unittest.TextTestRunner().run(suite)
    # unittest.main()